<template>
	<view class="Menu">
		<Quotation v-if="otcCurrent==0" />
		<Transaction v-else-if="otcCurrent==1" />
		<MyOtc v-else />

		<view class="foot">
			<view class="content" :style="{ top: $wanlshop.wanlsys().top + 'px' }">
				<view v-for="(item,index) in list" :key="index" :class="otcCurrent==index?'active':''"
					@click="otcChange(index)" class="Otclist">
					<view :class="'icon'+index" class="icon"></view>
					<view>{{item.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import Transaction from "./transaction.vue";
	import Quotation from "./quotation.vue";
	import MyOtc from "./myOtc.vue";
	export default {
		components: {
			Transaction,
			Quotation,
			MyOtc
		},
		data() {
			return {
				list: [{
						icon: '',
						name: this.$t('otc.tabbar.quotation') //'行情'
					}, {
						icon: '',
						name: '交易' //'兑换'
					},
					// {
					// 	icon: '',
					// 	name: this.$t('otc.tabbar.exchange') //'兑换'
					// },
					{
						icon: '',
						name: this.$t('otc.tabbar.my') //'我的'
					}
				],
				otcCurrent: 0,
			};
		},
		onLoad(option) {
			if (option && option.id) {
				this.otcCurrent = option.id

			}
		},
		methods: {
			otcChange(index) {
				this.otcCurrent = index;
			},

		}
	};
</script>

<style lang="scss">
	.Menu {

		.foot {
			width: 100%;
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;

			.content {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				background: #fff;
				padding: 20rpx 0;
				font-weight: 400;
				font-size: 24rpx;
				color: #999;
				text-align: center;

				.Otclist {
					width: 33.33%;

					.icon {
						width: 48rpx;
						height: 48rpx;
						margin: 0 auto;
						margin-bottom: 10rpx;
					}

					.icon0 {
						background: url('@/static/images/otc/icon1.png') no-repeat;
					}

					.icon1 {
						background: url('@/static/images/otc/icon2.png') no-repeat;
					}

					// .icon2 {
					// 	background: url('@/static/images/otc/icon2.png') no-repeat;
					// }

					.icon2 {
						background: url('@/static/images/otc/icon3.png') no-repeat;
					}
				}

				.active {
					color: #000;

					.icon0 {
						background: url('@/static/images/otc/icon1_hover.png') no-repeat;
					}

					.icon1 {
						background: url('@/static/images/otc/icon2_hover.png') no-repeat;
					}

					// .icon2 {
					// 	background: url('@/static/images/otc/icon2_hover.png') no-repeat;
					// }

					.icon2 {
						background: url('@/static/images/otc/icon3_hover.png') no-repeat;
					}
				}
			}
		}




	}
</style>